var adid = getParameter("adid");
var uid=getParameter("uid");
//获取url参数
function getParameter(param) {
	var query = window.location.search;
	var iLen = param.length;
	var iStart = query.indexOf(param);
	if (iStart == -1)
		return "";
	iStart += iLen + 1;
	var iEnd = query.indexOf("&", iStart);
	if (iEnd == -1)
		return query.substring(iStart);
	return query.substring(iStart, iEnd);
}

$(function(){
	var urlStr = serverPath + "/app/doctor/doctor/healthmessage.do";
	var jsonStr = '{method:"getBannerDetails",requestlist:[{ adid:"'+adid+'" }],  version:"1.0",uid:"'+uid+'", requestsource:"doctor"}' ;
	UseAjax(urlStr, jsonStr, document.cookie, test, '1');
});

function test(nodeArrays){
	var nodeArray=nodeArrays.resultlist[0].resultlist;
	if (nodeArray && nodeArray.title && nodeArray.content) {
		$('#title').html(nodeArray.title);
		$('#dates').html(nodeArray.dates.substring(0,10));
		$('#content').html(nodeArray.content);
		$('#readcount').html(nodeArray.readcount);
		
		/*if(nodeArray.picurl!=null){
			//隐藏视频div
			var style="display: none;"
			var v = document.getElementById("video");
			v.style.display="none";//隐藏释放页面空间
			$('#image_url').attr('src',nodeArray.picurl);
		}*/
		//初始化数据 关于页面的尺寸的设置
		var width = window.innerWidth, height = parseInt(parseInt(width
				* (9 / 16))), height = height > window.innerHeight ? window.innerHeight
				: height;
		window.tvpSetting = {
			width : width,
			height : height,
		};
		
		var videoid="l0171ne1fjx";
		//html5模式
		if(videoid!=null){
			//隐藏图片div
			var style="display: none;"
			var picture = document.getElementById("picture");
			picture.style.display="none";//隐藏释放页面空间
			//var videoid = nodeArray.videoid;
			//创建 tvp.VideoInfo 类（待播放的视频信息）的对象实例。
			var video = new tvp.VideoInfo();
			//视频vid，从腾讯视频V+上传得到。（点播视频）
			video.setVid(videoid);
			//创建 tvp.Player 类（播放器信息）的对象实例。
			var player =new tvp.Player();
			//默认封面图
			player.create({
				  width  : tvpSetting.width,
				  height : tvpSetting.height,
				  pic    : tvp.common.getVideoSnapMobile(videoid),
				  video  : video,
				  modId  : 'video',
				  playerType: 'html5',
				  isContinuePlay: false,
				  loadingadAutoplay: false,
				  autoplay: false,
				  autoplayAfterLoadingad: true,
				  isHtml5ShowLoadingAdOnStart: false,
				  //isHtml5ShowLoadingAdOnChange: false
				  isContinuePlay:false
				});
		}
		//传统模式
		/*if(nodeArray.videoid!=null){
			//隐藏图片div
			var style="display: none;"
				var picture = document.getElementById("picture");
			picture.style.display="none";//隐藏释放页面空间
			var videoid = nodeArray.videoid;
			//创建 tvp.VideoInfo 类（待播放的视频信息）的对象实例。
			var video = new tvp.VideoInfo();
			//视频vid，从腾讯视频V+上传得到。（点播视频）
			video.setVid(videoid);
			//创建 tvp.Player 类（播放器信息）的对象实例。
			var player =new tvp.Player();
			//默认封面图
			player.create({
				width  : tvpSetting.width,
				height : tvpSetting.height,
				pic    : tvp.common.getVideoSnapMobile(videoid),
				video  : video,
				modId  : 'video1',
				isContinuePlay: false,
				loadingadAutoplay: false,
				autoplay: false,
				isHtml5ShowLoadingAdOnStart: false,
				autoplayAfterLoadingad: true
			});
		}*/
	}	
}


